<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        var a = prompt('请输入一个数字')
        var b = prompt('请输入一个数字')
        fn(a, b)

        function fn(a, b) {
            var max = a
            var min = b
            if (a < b) {
                max = b
                min = a
            }
            for (var i = min; i < max; i++) {

                var flag = true
                for (var j = 2; j < i; j++) {
                    if (i % j === 0) {
                        flag = false
                        break
                    }
                }
                if (flag) {
                    console.log(i)
                }
            }
        }
    </script>
</body>

</html>